
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>
   <TITLE>kinfo_c</TITLE>
</HEAD>

<BODY style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<A name="TOP"></A>

<table style="text-align: left; margin-left: auto; margin-right: auto; width: 800px;"
 border="0" cellpadding="5" cellspacing="2">
  <tbody>
    <tr>
      <td style="background-color: rgb(153, 153, 153); vertical-align: middle; text-align: center;">
      <div align="right"> 
      <small><small><a href="index.html">Index Page</a></small></small>
      </div>
      <b>kinfo_c</b> </td>
    </tr>

    <tr>
      <td style="vertical-align: top;">

<small><div align="center">
<A HREF="index.html#A">A</A>&nbsp;
<A HREF="index.html#B">B</A>&nbsp;
<A HREF="index.html#C">C</A>&nbsp;
<A HREF="index.html#D">D</A>&nbsp;
<A HREF="index.html#E">E</A>&nbsp;
<A HREF="index.html#F">F</A>&nbsp;
<A HREF="index.html#G">G</A>&nbsp;
<A HREF="index.html#H">H</A>&nbsp;
<A HREF="index.html#I">I</A>&nbsp;
<A HREF="index.html#J">J</A>&nbsp;
<A HREF="index.html#K">K</A>&nbsp;
<A HREF="index.html#L">L</A>&nbsp;
<A HREF="index.html#M">M</A>&nbsp;
<A HREF="index.html#N">N</A>&nbsp;
<A HREF="index.html#O">O</A>&nbsp;
<A HREF="index.html#P">P</A>&nbsp;
<A HREF="index.html#Q">Q</A>&nbsp;
<A HREF="index.html#R">R</A>&nbsp;
<A HREF="index.html#S">S</A>&nbsp;
<A HREF="index.html#T">T</A>&nbsp;
<A HREF="index.html#U">U</A>&nbsp;
<A HREF="index.html#V">V</A>&nbsp;
<A HREF="index.html#W">W</A>&nbsp;
<A HREF="index.html#X">X</A>&nbsp;
</div></small>
       <br>
       <table style="text-align: left; width: 60%; margin-left: auto; margin-right: auto;"
       border="0" cellspacing="2" cellpadding="2">
        <tbody>
          <tr>
            <td style="width: 50%; text-align: center;">
            <small>
              <a href="#Procedure">Procedure<br></a>
              <a href="#Abstract">Abstract<br></a>
              <a href="#Required_Reading">Required_Reading<br></a>
              <a href="#Keywords">Keywords<br></a>
              <a href="#Brief_I/O">Brief_I/O<br></a>
              <a href="#Detailed_Input">Detailed_Input<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Detailed_Output">Detailed_Output<br></a>
              <a href="#Parameters">Parameters<br></a>
              <a href="#Exceptions">Exceptions<br></a>
              <a href="#Files">Files<br></a>
              <a href="#Particulars">Particulars<br></a>
              <a href="#Examples">Examples<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Restrictions">Restrictions<br></a>
              <a href="#Literature_References">Literature_References<br></a>
              <a href="#Author_and_Institution">Author_and_Institution<br></a>
              <a href="#Version">Version<br></a>
              <a href="#Index_Entries">Index_Entries<br></a>
             </small>
            </td>
          </tr>
        </tbody>
</table>

<h4><a name="Procedure">Procedure</a></h4>
<PRE>
   void kinfo_c ( ConstSpiceChar  * file,
                  SpiceInt          typlen,
                  SpiceInt          srclen,
                  SpiceChar       * filtyp,
                  SpiceChar       * source,
                  SpiceInt        * handle,
                  SpiceBoolean    * found  )
</PRE>
<h4><a name="Abstract">Abstract</a></h4>
<PRE>
 
   Return information about a loaded kernel specified by name. 
 </PRE>
<h4><a name="Required_Reading">Required_Reading</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Keywords">Keywords</a></h4>
<PRE>
 
   KERNEL 
 

</PRE>
<h4><a name="Brief_I/O">Brief_I/O</a></h4>
<PRE>
 
   VARIABLE  I/O  DESCRIPTION 
   --------  ---  -------------------------------------------------- 
   file       I   Name of a kernel to fetch information for 
   typlen     I   Available space in output kernel type string.
   srclen     I   Available space in output source string.
   filtyp     O   The type of the kernel. 
   source     O   Name of the source file used to load file. 
   handle     O   The handle attached to file. 
   found      O   SPICETRUE if the specified file could be located. 
 </PRE>
<h4><a name="Detailed_Input">Detailed_Input</a></h4>
<PRE>
 
   file        is the name of a kernel file for which descriptive 
               information is desired. 
 
   typlen      is the amount of available space in the output kernel 
               type string.
               
   srclen      is the amount of available space in the output kernel 
               source string.
               
               </PRE>
<h4><a name="Detailed_Output">Detailed_Output</a></h4>
<PRE>
 
   filtyp      is the type of the kernel specified by file.  filtyp 
               will be empty if file is not on the list of kernels
               loaded via <a href="furnsh_c.html">furnsh_c</a>. 
 
   source      is the name of the source file that was used to 
               specify file as one to load.  If file was loaded 
               directly via a call to <a href="furnsh_c.html">furnsh_c</a>, source will be empty. 
               If file is not on the list of kernels loaded via
               <a href="furnsh_c.html">furnsh_c</a>, source will be empty.
 
   handle      is the handle attached to file if it is a binary 
               kernel.  If file is a text kernel or meta-text kernel 
               handle will be zero. If file is not on the list of 
               kernels loaded via <a href="furnsh_c.html">furnsh_c</a>, handle will be set to zero.
 
   found       is returned SPICETRUE if the specified file exists.
               If there is no such file, found will be set to 
               SPICEFALSE. 
 </PRE>
<h4><a name="Parameters">Parameters</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Exceptions">Exceptions</a></h4>
<PRE>
 
   1) If the specified file is not on the list of files that 
      are currently loaded via the interface <a href="furnsh_c.html">furnsh_c</a>, found 
      will be SPICEFALSE, handle will be set to zero and filtyp 
      and source will be set to empty strings. 
 
   2) If any input or output character argument pointer is null, the 
      error SPICE(NULLPOINTER) will be signaled.
      
   3) If either output string length argument is less than 1, the
      error SPICE(STRINGTOOSHORT) will be signaled. 

   4) If either output string has length at least 1 but is too short to
      contain the output string, the corresponding is truncated on the 
      right.  The output string is still null-terminated.
 </PRE>
<h4><a name="Files">Files</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Particulars">Particulars</a></h4>
<PRE>
 
   This entry point allows you to request information directly 
   for a specific SPICE kernel. 
 </PRE>
<h4><a name="Examples">Examples</a></h4>
<PRE>
 
   Suppose you wish to determine the type of a loaded kernel 
   so that you can call the correct summarizing routines 
   for the kernel.  The following bit of pseudo code shows 
   how you might use this entry point together with summarizing 
   code to produce a report on the file.  (Note that the 
   routines spk_summry, ck_summry, pck_summry and ek_summry 
   are simply names to indicate what you might do with the 
   information returned by <b>kinfo_c</b>.  They are not routines that 
   are part of the SPICE Toolkit.) 

      #include &lt;stdio.h&gt;
      #include &quot;SpiceUsr.h&quot;

      #define  FILLEN   128
      #define  TYPLEN   32
      #define  SRCLEN   128

      SpiceInt        which;
      SpiceInt        count;
      SpiceInt        handle;

      SpiceChar       file  [FILLEN];
      SpiceChar       filtyp[TYPLEN];
      SpiceChar       source[SRCLEN];

      SpiceBoolean    found;

      int main()
         { 
         <a href="furnsh_c.html">furnsh_c</a>( &quot;/kernels/standard.tm&quot; );
   
         <a href="ktotal_c.html">ktotal_c</a> ( &quot;all&quot;, &amp;count );
    
         if ( count == 0 )
            {
            printf ( &quot;No files loaded at this time.\n&quot; );
            }
         else
            {
            printf ( &quot;The loaded files files are: \n\n&quot; );
            }
    
         for ( which = 0;  which &lt; count;  which++ )
            {

            <a href="kdata_c.html">kdata_c</a> ( which,  &quot;all&quot;,    FILLEN,   TYPLEN, SRCLEN, 
                     file,   filtyp,  source,  &amp;handle,  &amp;found ); 

            <b>kinfo_c</b> ( file, TYPLEN, SRCLEN, filtyp, source, &amp;handle, &amp;found );

               if (  <a href="eqstr_c.html">eqstr_c</a> ( filtyp, &quot;SPK&quot; )  )
                  {
                  printf ( &quot;%s is an SPK file.\n&quot;, file );
                  }
               else if (  <a href="eqstr_c.html">eqstr_c</a> ( filtyp, &quot;CK&quot; )  )
                  {
                  printf ( &quot;%s is a CK file.\n&quot;, file );
                  }
               else if (  <a href="eqstr_c.html">eqstr_c</a> ( filtyp, &quot;PCK&quot; )  )
                  {
                  printf ( &quot;%s is a PCK file.\n&quot;, file );
                  }
               else if (  <a href="eqstr_c.html">eqstr_c</a> ( filtyp, &quot;EK&quot; )  )
                  {
                  printf ( &quot;%s is an EK file.\n&quot;, file );
                  }
               else if (  <a href="eqstr_c.html">eqstr_c</a> ( filtyp, &quot;META&quot; )  )
                  {
                  printf ( &quot;%s is a meta-text kernel.\n&quot;, file );
                  }
               else 
                {
                printf ( &quot;%s is a text kernel.\n&quot;, file );
                }
                
             }

          }
      
 </PRE>
<h4><a name="Restrictions">Restrictions</a></h4>
<PRE>
 
   None.
 </PRE>
<h4><a name="Literature_References">Literature_References</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Author_and_Institution">Author_and_Institution</a></h4>
<PRE>
 
   N.J. Bachman    (JPL)
   W.L. Taber      (JPL) 
 </PRE>
<h4><a name="Version">Version</a></h4>
<PRE>
   -CSPICE Version 1.1.2, 02-MAY-2008 (EDW)

      standard.ker renamed standard.tm

   -CSPICE Version 1.1.1, 05-SEP-2007 (EDW)
 
      Expanded Examples section to a full, compilable program. 
 
   -CSPICE Version 1.1.0, 02-FEB-2003 (EDW)

      Corrected example code to match routine's argument list.

   -CSPICE Version 1.0.0, 01-SEP-1999 (NJB) (WLT)
</PRE>
<h4><a name="Index_Entries">Index_Entries</a></h4>
<PRE>
 
   Fetch information about a loaded SPICE kernel 
 </PRE>
<h4>Link to routine kinfo_c source file <a href='../../../src/cspice/kinfo_c.c'>kinfo_c.c</a> </h4>

      </td>
    </tr>
  </tbody>
</table>

   <pre>Wed Jun  9 13:05:25 2010</pre>

</body>
</html>

